package com.yuer.resumer.controller;

import com.yuer.resumer.service.ResumerService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "ResumerController" , tags = "建立相关的接口")
@RestController
@RequestMapping("/resumer")
public class ResumerController {

    @Autowired
    private ResumerService resumeService;

//    @GetMapping("/openstate/{userId}")
//    public Integer findDefaultResumeState(@PathVariable Long userId) {
//        return resumeService.findDefaultResumeByUserId(userId).getIsOpenResume();
//
//    }

    @Value("${server.port}")
    private Integer port;

    @GetMapping("/openstate/{userId}")
    public Integer

    findDefaultResumeState(@PathVariable Long userId) {
        try {
            Thread.sleep(16000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(port);
//        return resumeService.findDefaultResumeByUserId(userId).getIsOpenResume();
        return  port;
    }
}
